package com.cxh.supermarket.common.translation.impl;

import com.cxh.supermarket.common.annotation.TranslationType;
import com.cxh.supermarket.common.constant.TransConstant;
import com.cxh.supermarket.common.core.service.InforTypeService;
import com.cxh.supermarket.common.translation.TranslationInterface;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 资讯分类名称翻译
 *
 * @author lly
 * @create 2024/4/8 15:29
 */
@Component
@AllArgsConstructor
@TranslationType(type = TransConstant.INFORMATION_TYPE_ID_TO_NAME)
public class InforTypeServiceTranslationImpl implements TranslationInterface<String> {

  private final InforTypeService inforTypeService;

  @Override
  public String translation(Object key, String other) {
    return inforTypeService.selectinforTypeNameByIds(key.toString());
  }
}
